home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-0039
/
source
/
dcprtcnv.def
< prev
next >
Wrap
Text File
|
1997-04-16
|
6KB
|
103 lines
DEFINITION MODULE DCPrtCnv;
(*----------------------------------------------------------------------*)
(* *)
(* Version 1.00 July 1988 L.G. Miller *)
(* *)
(* This is a library module for Degas Convert & Print initially, but *)
(* can be made more general purpose later. *)
(* *)
(* What it does: *)
(* It returns 'slices' of a monochrome bit image as characters in *)
(* a form suitable for throwing at a printer. *)
(* *)
(* If required:- *)
(* It will scale the output picture. *)
(* *)
(* It will use a rectangular portion of the input picture. *)
(* *)
(* It will rotate the image by a 90 degrees. *)
(* *)
(* Limitations. *)
(* *)
(* As its designed for working with printers, the output is aimed *)
(* at 8 & 24 pin printers. *)
(* *)
(* As fixed point calculations are used, the scaling will be limited *)
(* in range. *)
(* *)
(* The scaling factor will be decided by the input & output sizes *)
(* requested which will be in 'dots'. Be aware that fixed precision *)
(* calculations are used and results will be strange if extremes of *)
(* scaling are required. Try and keep the range within 1/4 .. 4 times. *)
(* *)
(* The output will be in whole character intervals i.e. multiples *)
(* of 8 bits. This version will only use 8 or 24 bits. The 24 bit *)
(* output will be <top> <middle> <bottom> order for each column to *)
(* be printed. *)
(* *)
(* These routines will be less than quick! *)
(* *)
(* How to use the routines *)
(* ----------------------- *)
(* *)
(* 1) The first call will initialise the conversion routine with *)
(* the picture, scaling etc and returns the first slice. *)
(* *)
(* 2) subsequent calls will return a 'slice' until the end of *)
(* the picture. *)
(* *)
(* The conversion can be restarted or changed on any call. *)
(* *)
(* These routines can ONLY work on ONE picture at a time as it *)
(* 'remembers' the previous values of the variables. *)
(* *)
(* *)
(*----------------------------------------------------------------------*)
FROM DCGlobal IMPORT HiResScreen,
PrinterTypes;
PROCEDURE SetPrinterToUse( printer : PrinterTypes );
PROCEDURE QueryPrinterToUse() : PrinterTypes;
PROCEDURE PrtCnv8BitSlice ( NewPicture : BOOLEAN; (* TRUE is restart *)
VAR last : BOOLEAN; (* TRUE if end *)
VAR pic : HiResScreen;
InX, InY, (* start co-ord in pic *)
PicWidth, (* width (width) reqd. *)
PicHeight, (* depth (pixel) reqd. *)
PrintWidth, (* print dot width reqd. *)
PrintHeight (* print dot depth reqd. *)
: INTEGER;
Landscape : BOOLEAN; (* TRUE = Landscape*)
(* x is vertical *)
VAR buffer : ARRAY OF CHAR (* out *)
);
PROCEDURE PrtCnv24BitSlice ( NewPicture : BOOLEAN; (* TRUE is restart *)
VAR last : BOOLEAN; (* TRUE if end *)
VAR pic : HiResScreen;
InX, InY, (* start co-ord in pic *)
PicWidth, (* width (pixels) reqd. *)
PicHeight, (* depth (pixels) reqd. *)
PrintWidth, (* print width reqd. *)
PrintHeight (* print depth reqd. *)
: INTEGER;
Landscape : BOOLEAN;(* TRUE = Landscape*)
(* x is vertical *)
VAR buffer : ARRAY OF CHAR (* out *)
);
END DCPrtCnv.